In a NAND flash memory of the related art, verification is performed in writing data. There is well known a function (hereinafter referred to as a pseudo-pass function) of ending a program sequence when the number of verify-failed bits is a predetermined number or less.
A circuit technology of counting the number of verify-failed bits is required to adopt the pseudo-pass function.